#include "CNewGraf.h"
#include "CFifteen.h"
#include <iostream>
#include <bitset>
#include <string>

using namespace std;

void main()
{
	CFifteen fivt;
 
	int ps[16] = {4,1,3,9,2,14,7,10,0,11,6,12,5,15,13,8};
	try
	{
		bitset<64> st = fivt.MakePosition( ps );
		fivt.PrintOptimalSolve( st );
	}
	catch( CSolveDoesntExistException err )
	{
		cout << err.GetDescription() << endl;
	}
	catch( CIncorrectPositionException err )
	{
		cout << err.GetDescription() << endl;
	}
	catch( OutOfRangeException err )
	{
		cout << err.GetDescription() << endl;
	}
	catch( IncorrectEdge err )
	{
		cout << err.GetDescription() << endl;
	}
	catch( WayDoesntExistException err )
	{
		cout << err.GetDescription() << endl;
	}
}